{include file="index/header" /}
<link rel="stylesheet" type="text/css" href="__PUBLIC__css/jedate.css">
<script type="text/javascript" src="__PUBLIC__js/jquery.jedate.min.js"></script>
<body>
	<div class="panel admin-panel">
		<form method="post" action="" id="listform">
			<div class="panel-head"><strong class="icon-reorder"> 内容列表</strong></div>
			<div class="padding border-bottom">
				<ul class="search" style="padding-left:10px;">
					<li>
						<li>
							<input type="text" placeholder="开始日期" id="test" name="start_time" value="{$param.start_time}" class="input jcDate" style="width:110px; line-height:17px;display:inline-block" AUTOCOMPLETE="OFF"/> -
							<input type="text" placeholder="结束日期" id="test" name="end_time" value="{$param.end_time}" class="input jcDate" style="width:110px; line-height:17px;display:inline-block" AUTOCOMPLETE="OFF"/>
							<input type="search" placeholder="手机号/邮箱" name="phone" value="{$param.phone}" class="input"  style="width:250px; line-height:17px;display:inline-block;"/>
						</li>
						<a href="javascript:void(0)" class="button border-main" onclick="changesearch()">搜索用户</a>
					</ul>
				</div>
				<table class="table table-hover text-center">
					<tr>
						<th>序号</th>
						<th>用户ID</th>
						<th>昵称</th>
						<th>手机号</th>
						<th width="30%">会员身份</th>
						<th>成为会员时间</th>
						<th>注册时间</th>
						<th>注册来源</th>
						<th>备注（大学/合作机构）</th>
						<th>操作</th>
					</tr>
					{foreach name='user_data' item='v' key='k'}
					<tr>
						<td>{$k+1}</td>
						<td><input type="checkbox" name="user_id[]" value="{$v.know_user_id}" />{$v.know_user_id}</td>
						<td>{$v.know_nickname}</td>
						<td>{if $v.know_phone}{$v.know_phone}{else}{$v.know_email}{/if}</td>
						<td width="30%">{$v.type}</td>
						<td>{$v.vipTime}</td>
						<td>{$v.register_time}</td>
						<td>{if $v.action eq 0}PC{elseif $v.action eq 1}手机{else}小程序{/if}</td>
						<td>{$v.desc}</td>
						<td><div class="button-group"> <a class="button border-main" href="{:url('nav_price',['id' => $v['know_user_id'],'page'=>$page,'phone'=>$param['phone'],'start_time'=>$param['start_time'],'end_time'=>$param['end_time']])}"><span class="icon-edit"></span>设置用户身份</a><a class="button border-main" href="{:url('detail',['id' => $v['know_user_id']])}">查看详情</a></div></td>
					</tr>
					{/foreach}
					<tr>
						<td colspan="12" align="left"><input type="checkbox" id="checkall"/>
						全选 </td>
					</tr>
					<tr><td colspan="12">{$user_data->render()}</td></tr>
				</table>
			</div>
		</form>
	</body></html>
	<script>
  //搜索
  function documents(){  
  	$("#listform").submit();
  }

  function changesearch(){
    $("#listform").attr('action','/admin/user/index');    //通过jquery为action属性赋值
    $("#listform").submit();    //提交ID为myform的表单
}

  //全选
  $("#checkall").click(function(){ 
  	$("input[name='user_id[]']").each(function(){
  		if (this.checked) {
  			this.checked = false;
  		}
  		else {
  			this.checked = true;
  		}
  	});
  });
  $(".jcDate").jeDate({
  	format:"YYYY-MM-DD",
  	isTime:false, 
  	minDate:"2014-09-19 00:00:00"
  });
</script>